<?php
 	session_start();
	
	//include("../../config.php");
	include("../../common/ClassConnect.php");
	
	include("../../iconn.php");
	include("../post/postclass.php");
	$ob=new ClassConnect();
	$conn = $ob->connecttion($host,$db,$user,$pass);
	$obj=new Post();
	$type=$_GET['type'];
	
?>
<p align="right"><a onClick="document.getElementById('view<?php echo $type?>').innerHTML=''; hidden('view<?php echo $type?>')">Close [x]</a></p>
<table width="100%" border="1px">

			<?php
                $where=" WHERE 1=1 ";
                $where.=" AND NewsTypeID = '$type' ORDER BY `LastUpdate` DESC";
                $obj=new Post();
                $data=array();
                $data=$obj->travel($where);
                
                include '../../common/page.php';
                /*******Start Paging*****************************/
                $page = $_GET['page'];				
                $limit = 3; 
                $total = count($data); 
                // work out the pager values 
                $pager  = Pager::getPagerData($total, $limit, $page); 
                $offset = $pager->offset; 
                $limit  = $pager->limit; 
                $page   = $pager->page;
                /*******Break paging*******************************/
                for($i=$offset;$i<$offset+$limit && $data[$i]!="";$i++)
                {
                    $obj->loadByKey($data[$i]);
                    $class="even";
                    if($i%2!=0)
                        $class="odd";
            ?>                               
               	<tr valign="top">         
                        <td><a class="btlink" href="?module=post&action=get&cid=<?php echo $obj->NewsTypeID?>&id=<?php echo $obj->PostID?>"><?php echo $obj->Title?></a></td>
                        
                </tr>       	
            <?php
                }
            ?>


</table>
<?php
	include("../pageajax.php");
?>
<?php
	$ob->close($conn);  
?>